// Harris_corner_detection.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h" 
#include "Harris_corner_detection.h"
//bool Compare_Cr(vector<Point2f> corners1, vector<Point2f> corners2);

int main()
{
    //extern struct Bian bian, bian2;

	//以灰度模式载入图像并显示
	//Mat srcImage1 = imread("TL01.png", 0);
	//Mat srcImage1 = imread("screen02.png", 0);
	//**Mat srcImage1 = imread("L02.png", 0);

	//Mat srcImage2 = imread("TL02.png", 0);
	//Mat srcImage3 = imread("TL03.png", 0);
	//Mat srcImage4 = imread("TL04.png", 0);
	//Mat srcImage5 = imread("TL05.png", 0);
	//Mat srcImage6 = imread("TL06.png", 0);
	//Mat srcImage01 = imread("T01.png", 0);
	Mat srcImage02= imread("T02.png", 0);
	//Mat srcImage03= imread("T03.png", 0);
	//Mat srcImage04= imread("T04.png", 0);
	Mat srcImage11 = imread("T1.png", 0);
	Mat srcImage12 = imread("T2.png", 0);
	Mat srcImage_1 = imread("1.png", 0);



	//Mat copy = srcImage1.clone();
	//Mat cornerStrength;
	//vector<Point2f> corners1 = GetCorners(srcImage1);
	//vector<Point2f> corners2 = GetCorners(srcImage2);
	//vector<Point2f> corners3 = GetCorners(srcImage3);
	//vector<Point2f> corners4 = GetCorners(srcImage4);
	//vector<Point2f> corners5 = GetCorners(srcImage5);
	//vector<Point2f> corners6 = GetCorners(srcImage6);
	//vector<Point2f> corners01 = GetCorners(srcImage01);
	vector<Point2f> corners02= GetCorners(srcImage02);
	//vector<Point2f> corners03= GetCorners(srcImage03);
	//vector<Point2f> corners04 = GetCorners(srcImage04);
	vector<Point2f> corners11 = GetCorners(srcImage11);
	vector<Point2f> corners12 = GetCorners(srcImage12);
	vector<Point2f> corners_1 = GetCorners(srcImage_1);



	//Bian bian_1 = Cr2(corners1,srcImage1);
	//Bian bian_2 = Cr2(corners2,srcImage2);
	//Bian bian_3 = Cr2(corners3, srcImage3);
	//Bian bian_4 = Cr2(corners4, srcImage4);
	//Bian bian_5 = Cr2(corners5, srcImage5);
	//Bian bian_6 = Cr2(corners6, srcImage6);
	//Bian bian_01 = Cr(corners01, srcImage01);
	Bian bian_02 = Cr2(corners02, srcImage02);
	//Bian bian_03 = Cr2(corners03, srcImage03);
	//Bian bian_04 = Cr2(corners04, srcImage04);
	//****Bian bian_11 = Cr(corners11, srcImage11);
	//printf("%f,%f,%f,%f\n", bian_11.bian[0], bian_11.bian[1], bian_11.bian[2], bian_11.bian[3]);
	Bian bian_12 = Cr(corners12, srcImage12);
	//printf("%f,%f,%f,%f\n", bian_12.bian[0], bian_12.bian[1], bian_12.bian[2], bian_12.bian[3]);

	//Bian bian_y1= Cr2(corners_1, srcImage_1);

	Cmp_bili(bian,bian2);
	//Cmp_bili(Cr(corners11, srcImage11), Cr2(corners12, srcImage12));
	//Cmp_bili(bian_11, bian_12);
	//CompareCr(corners01,corners1);
//	CompareCr(GetCorners(srcImage1), GetCorners(srcImage2));
//		printf("%f", d);
	//cvWaitKey(100000);
	waitKey();
	return 0;
}

/*//进行Harris角点检测找出角点
cornerHarris(srcImage, cornerStrength, 2, 3, 0.01);
//对灰度图进行阈值操作，得到二值图并显示
Mat harrisCorner;
threshold(cornerStrength, harrisCorner, 0.00001, 255, THRESH_BINARY);
imshow("2", harrisCorner);
*/

//for (int i=0;i<corners.size(); i++)